---
id: 61537d86bdc3dd343688fceb
title: Passo 6
challengeType: 0
dashedName: step-6
---

# --description--

Em seguida, dê a cada `img` um atributo `src` de acordo com sua ordem no documento. A primeira `img` deve ter para o atributo `src` o valor de `https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg`. O resto deve ser o mesmo, porém substituindo o `1` pelo número da `img` na sequência em que está no documento.

# --hints--

Todos os nove elementos `img` devem ter um atributo `src`.

```js
const images = [...document.querySelectorAll('img')];
assert(images.every(image => image.getAttribute('src')));
```

O primeiro elemento `img` deve ter o valor do atributo o `src` definido como `https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg`.

```js
assert(document.querySelectorAll('img')?.[0]?.getAttribute('src') === 'https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg');
```

O segundo elemento `img` deve ter o valor do atributo o `src` definido como `https://cdn.freecodecamp.org/curriculum/css-photo-gallery/2.jpg`.

```js
assert(document.querySelectorAll('img')?.[1]?.getAttribute('src') === 'https://cdn.freecodecamp.org/curriculum/css-photo-gallery/2.jpg');
```

O terceiro elemento `img` deve ter o valor do atributo o `src` definido como `https://cdn.freecodecamp.org/curriculum/css-photo-gallery/3.jpg`.

```js
assert(document.querySelectorAll('img')?.[2]?.getAttribute('src') === 'https://cdn.freecodecamp.org/curriculum/css-photo-gallery/3.jpg');
```

O quarto elemento `img` deve ter o valor do atributo o `src` definido como `https://cdn.freecodecamp.org/curriculum/css-photo-gallery/4.jpg`.

```js
assert(document.querySelectorAll('img')?.[3]?.getAttribute('src') === 'https://cdn.freecodecamp.org/curriculum/css-photo-gallery/4.jpg');
```

O quinto elemento `img` deve ter o valor do atributo o `src` definido como `https://cdn.freecodecamp.org/curriculum/css-photo-gallery/5.jpg`.

```js
assert(document.querySelectorAll('img')?.[4]?.getAttribute('src') === 'https://cdn.freecodecamp.org/curriculum/css-photo-gallery/5.jpg');
```

O sexto elemento `img` deve ter o valor do atributo o `src` definido como `https://cdn.freecodecamp.org/curriculum/css-photo-gallery/6.jpg`.

```js
assert(document.querySelectorAll('img')?.[5]?.getAttribute('src') === 'https://cdn.freecodecamp.org/curriculum/css-photo-gallery/6.jpg');
```

O sétimo elemento `img` deve ter o valor do atributo o `src` definido como `https://cdn.freecodecamp.org/curriculum/css-photo-gallery/7.jpg`.

```js
assert(document.querySelectorAll('img')?.[6]?.getAttribute('src') === 'https://cdn.freecodecamp.org/curriculum/css-photo-gallery/7.jpg');
```

O oitavo elemento `img` deve ter o valor do atributo o `src` definido como `https://cdn.freecodecamp.org/curriculum/css-photo-gallery/8.jpg`.

```js
assert(document.querySelectorAll('img')?.[7]?.getAttribute('src') === 'https://cdn.freecodecamp.org/curriculum/css-photo-gallery/8.jpg');
```

O nono elemento `img` deve ter o valor do atributo o `src` definido como `https://cdn.freecodecamp.org/curriculum/css-photo-gallery/9.jpg`.

```js
assert(document.querySelectorAll('img')?.[8]?.getAttribute('src') === 'https://cdn.freecodecamp.org/curriculum/css-photo-gallery/9.jpg');
```

# --seed--

## --seed-contents--

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Photo Gallery</title>
    <link rel="stylesheet" href="./styles.css">
  </head>
  <body>
    <header class="header">
      <h1>css flexbox photo gallery</h1>
    </header>
--fcc-editable-region--
    <div class="gallery">
      <img>
      <img>
      <img>
      <img>
      <img>
      <img>
      <img>
      <img>
      <img>
    </div>
--fcc-editable-region--
  </body>
</html>
```

```css

```
